<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test.js"></script>
</head>
<body id="body">

<div tabindex=0 id="scroller1" aria-valuenow="55" role="scrollbar" aria-orientation="vertical">scrollbar</div>
<div tabindex=0 id="scroller2" aria-valuenow="55" role="scrollbar">scrollbar</div>

<p id="description"></p>
<div id="console"></div>

<script>

    description("This tests that the ARIA scrollbar role works correctly");

    if (window.accessibilityController) {

        document.getElementById("scroller1").focus();
        var scroller = accessibilityController.focusedElement;
        shouldBe("scroller.role", "'AXRole: AXScrollBar'");
        shouldBe("scroller.intValue", "55");
        shouldBe("scroller.orientation", "'AXOrientation: AXVerticalOrientation'");

        document.getElementById("scroller1").setAttribute("aria-orientation", "horizontal");
        shouldBe("scroller.orientation", "'AXOrientation: AXHorizontalOrientation'");

        // Default orientation should be vertical for scrollbars
        document.getElementById("scroller2").focus();
        scroller = accessibilityController.focusedElement;
        shouldBe("scroller.role", "'AXRole: AXScrollBar'");
        shouldBe("scroller.intValue", "55");
        shouldBe("scroller.orientation", "'AXOrientation: AXVerticalOrientation'");

    }

</script>

</body>
</html>
